package org.unit.testmgmt.ui.preferences;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.unit.testmgmt.Activator;
import org.unit.testmgmt.messages.Messages;
import org.unit.testmgmt.preferences.IUTMPreferenceConstants;

/**
 * The page for the main preferences.
 * 
 * @author Robert Streng
 *
 */
public class UTMPreferenceMainPage extends FieldEditorPreferencePage
		implements IWorkbenchPreferencePage, IUTMPreferenceConstants {
	public UTMPreferenceMainPage() {
	}

	@Override
	public void init(IWorkbench workbench) {
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
		setDescription(Messages.UTMPreferenceMainPage_description_Main_settings);
	}

	@Override
	protected void createFieldEditors() {
		addField(new StringFieldEditor(TEST_PROJECT_POSTFIX, Messages.UTMPreferenceMainPage_Test_project_postfix,
				getFieldEditorParent()));

		addField(new StringFieldEditor(TEST_PACKAGE_POSTFIX, Messages.UTMPreferenceMainPage_Test_package_postfix,
				getFieldEditorParent()));
		
		addField(new StringFieldEditor(TEST_CLASS_POSTFIX, Messages.UTMPreferenceMainPage_Test_class_postfix,
				getFieldEditorParent()));
		
		addField(new StringFieldEditor(TEST_METHOD_PREFIX, Messages.UTMPreferenceMainPage_Test_method_prefix,
				getFieldEditorParent()));
		
		addField(new StringFieldEditor(TEST_METHOD_POSTFIX, Messages.UTMPreferenceMainPage_Test_Method_postfix,
				getFieldEditorParent()));
		
		addField(new StringFieldEditor(TEST_CLASS_SUPER_TYPE, Messages.UTMPreferenceMainPage_Testclass_supertype,
				getFieldEditorParent()));
		
		addField(new StringFieldEditor(TML_CONTAINER, Messages.UTMPreferenceMainPage_TML_container,
				getFieldEditorParent()));
		
	}

}
